home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
basic
/
spiro.zip
/
DOSSPIRO.ZIP
/
EPICYCS.BAS
next >
Wrap
BASIC Source File
|
1990-09-29
|
754b
|
27 lines
100 KEY OFF
110 WD=639: HT=349
120 X0=WD/2: Y0=HT/2
130 PI=3.1415926#
160 SCREEN 2,1: WIDTH 80: CLS
165 PRINT "Draw an epicycloid"
170 INPUT "Ratio of fixed to rolling circle ( 0 = quit )"; R
180 IF R = 0 THEN END
190 PRINT "Enter the pen position w.r.t. a circle of radius 1."
200 PRINT "<1 is inside, =1 is on circle, >1 is outside"
210 INPUT "Pen position (<=0 to quit)";H
220 IF H<=0 THEN END
230 A=.5*R*HT/(R+H+1)
240 B=A/R
250 H=H*B
280 SCREEN 9,1: CLS
290 LINE(X0,0)-(X0,HT),2
300 LINE(0,Y0)-(WD,Y0),2
310 CIRCLE(X0,Y0),A,3
320 CIRCLE(X0+A+B,Y0),B,3
350 ANG=0
360 ANG=ANG+2*PI/600
370 X=X0+(A+B)*COS(ANG)-H*COS(ANG*(A+B)/B)
380 Y=Y0-(A+B)*SIN(ANG)+H*SIN(ANG*(A+B)/B)
390 PSET (X,Y),1
420 IF INKEY$<>"" THEN 160 ELSE 360